package org.springblade.modules.repair.entity;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.*;

import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;

/**
 * 故障工单明细
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "blade_maintain_malfunction_work")
public class MaintainMalfunctionWork extends TenantEntity {
	/**
	 * 任务id
	 */
	@TableField(value = "plan_id")
	private Long planId;

	/**
	 * 故障图片
	 */
	@TableField(typeHandler = JacksonTypeHandler.class)
	@ApiModelProperty(value = "故障图片和视频")
	private List<HashMap<String, String>> mfImgUrl;

	/**
	 * 故障描述
	 */
	@TableField(value = "mf_desc")
	private String mfDesc;

	/**
	 * 问题描述项，dict_key拼接
	 */
	@TableField(value = "problem_item", updateStrategy = FieldStrategy.IGNORED, insertStrategy = FieldStrategy.IGNORED)
	private String problemItem;

	/**
	 * 故障现象其他描述
	 */
	@TableField(value = "problem_other_desc", updateStrategy = FieldStrategy.IGNORED, insertStrategy = FieldStrategy.IGNORED)
	private String problemOtherDesc;

	/**
	 * 故障地点
	 */
	@TableField(value = "address")
	private String address;

	/**
	 * 报障人姓名
	 */
	@TableField(value = "`name`")
	private String name;

	/**
	 * 电梯状态： 1-正常,2-停梯
	 */
	@TableField(value = "elevator_stop", updateStrategy = FieldStrategy.IGNORED, insertStrategy = FieldStrategy.IGNORED)
	private Integer elevatorStop;

	/**
	 * 报障人联系方式
	 */
	@TableField(value = "phone")
	private String phone;

	/**
	 * 报障单位名称
	 */
	@TableField(value = "fault_company")
	private String faultCompany;


	/**
	 * 补充故障原因
	 */
	@TableField(value = "fault_reason_item", updateStrategy = FieldStrategy.IGNORED, insertStrategy = FieldStrategy.IGNORED)
	private String faultReasonItem;

	/**
	 * 补充故障原因其他描述
	 */
	@TableField(value = "fault_reason_other_desc", updateStrategy = FieldStrategy.IGNORED, insertStrategy = FieldStrategy.IGNORED)
	private String faultReasonOtherDesc;

	/**
	 * 故障说明
	 */
	@TableField(value = "fault_desc", updateStrategy = FieldStrategy.IGNORED, insertStrategy = FieldStrategy.IGNORED)
	private String faultDesc;

	/**
	 * 补充故障原因图片和视频
	 */
	@TableField(typeHandler = JacksonTypeHandler.class, updateStrategy = FieldStrategy.IGNORED, insertStrategy = FieldStrategy.IGNORED)
	@ApiModelProperty(value = "补充故障原因图片和视频")
	private List<HashMap<String, String>> faultImg;

	/**
	 * 处理结果更新时间
	 */
	private Date faultSubmitTime;

	/**
	 * 处理结果更新人id
	 */
	private Long faultSubmitUser;

	/**
	 * 部件id集合
	 */
	@TableField(value = "parts_ids")
	private String partsIds;

	/**
	 * 部件名称集合
	 */
	@TableField(value = "parts_names")
	private String partsNames;

	/**
	 * 层站结构id集合
	 */
	@TableField(value = "floor_stand_ids")
	private String floorStandIds;

	/**
	 * 层站结构名称集合
	 */
	@TableField(value = "floor_stand_names")
	private String floorStandNames;

	/**
	 * 任务来源
	 */
	@TableField(value = "plan_from")
	private Integer planFrom;

	@ApiModelProperty("维修记录id,来源")
	private Long malHistoryId;

	@ApiModelProperty("关闭描述")
	private String closeDesc;

	@ApiModelProperty("关闭人")
	private String closeUserName;

	@TableField(exist = false)
	@ApiModelProperty("维修故障原因")
	private List<String> problemItemNames;
	/**
	 * 1-无需更换 2-建议更换 3-已更换
	 */
	@TableField(value = "parts_ope")
	private Integer partsOpe;

	@ApiModelProperty("维修责任")
	private String wxFaultTypeIds;

}
